/// 社区点赞记录数据模型
/// 记录用户对社区帖子的点赞关系
class CommunityLikeEssence {
  final String userId;
  final String communityId;

  CommunityLikeEssence({required this.userId, required this.communityId});

  /// 从Map创建CommunityLikeEssence
  factory CommunityLikeEssence.fromMap(Map<String, dynamic> map) {
    return CommunityLikeEssence(
      userId: map['userId'] as String,
      communityId: map['communityId'] as String,
    );
  }

  /// 转换为Map
  Map<String, dynamic> toMap() {
    return {'userId': userId, 'communityId': communityId};
  }

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;
    return other is CommunityLikeEssence &&
        other.userId == userId &&
        other.communityId == communityId;
  }

  @override
  int get hashCode => userId.hashCode ^ communityId.hashCode;
}
